package ltd.rycloud.tms.service.impl;

import ltd.rycloud.tms.dao.UserDao;
import ltd.rycloud.tms.entity.User;
import ltd.rycloud.tms.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/***
 * @author     ：RYCloud.ltd ZhangLongBiao
 * @date       ：Created in 2019/6/24 3:07
 * @description：用户服务
 * @modified By：
 * @version: 1.0$
 *山东如翼云计算科技有限公司  张龙彪  15169994844
 ***/
@Service
public class UserServiceImpl  implements IUserService {
    @Autowired
    UserDao userDao;
    @Override
    public List<User> findAll(){
        return userDao.findAll();
    }
    @Override
    public User save(User user){
        return userDao.save(user);
    }
    @Override
    public  User findById(Integer id){
        return userDao.findById(id).get();
    }
    public  User login(String username,String password){
        return userDao.findByUsernameAndPassword(username,password);
    }

}
